<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Chaplin test runner</title>
    <link rel="stylesheet" href="lib/mocha-1.3.0.css" />
    <script src="lib/mocha-1.3.0.js"></script>
    <script src="lib/expect-0.1.2.js"></script>
    <script src="lib/sinon-1.4.2.js"></script>
    <script src="lib/sinon-expect-d3365d35.js"></script>
    <script src="lib/require-2.0.4.js"></script>
    <script>
      (function () {
        requirejs.config({
          baseUrl: 'js/',
          paths: {
            jquery: '../lib/jquery-1.7.2',
            underscore: '../lib/underscore-1.3.3',
            backbone: '../lib/backbone-0.9.2'
          },
          shim: {
            backbone: {
              deps: ['underscore', 'jquery'],
              exports: 'Backbone'
            },
            underscore: {
              exports: '_'
            }
          },
          // For easier development, disable browser caching
          urlArgs: 'bust=' +  (new Date()).getTime()
        });
      })();
      mocha.setup('bdd');
    </script>
    <script>
      window.expect = SinonExpect.enhance(expect, sinon, 'was');
      window.onload = function() {
        var specs = [
          'mediator',
          'router',
          'application',
          'layout',
          'dispatcher',
          'collection_view',
          'model',
          'collection',
          'controller',
          'view'
        ];
        var loaded = [];
        for (var i = 0, l = specs.length; i < l; i++) {
          loaded.push(specs[i] + '_spec');
        }
        require(loaded, function () {
          var runner = mocha.run();
          runner.globals(['jQuery*']);
        });
      };
    </script>
  </head>
  <body>
    <div id="mocha"></div>
    <div id="testbed"></div>
  </body>
</html>
